home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-in_the_mag-
/
reader_requests
/
scilab
/
man
/
man-part1
/
cat1
/
function.1
< prev
next >
Wrap
Text File
|
1999-09-16
|
1KB
|
67 lines
functions(1) Scilab Function functions(1)
NAME
"Scilab object : function" - Scilab procedure
DESCRIPTION
Functions are Scilab procedures ("macro", "function" and "procedure" have
the save meaning). Usually, they are defined in files with an editor and
loaded into Scilab by getf or through a library.
They can also be defined on-line (see deff). A file which contains a func-
tion must begin as follows:
function [y1,...,yn]=foo(x1,...,xm)
The yi are output variables calculated as functions of input variables and
variables existing in Scilab when the function is executed. A function can
be compiled for faster execution. Collections of functions can be collected
in libraries. Functions which begin with % sign (e.g. %foo) and whose
arguments are lists are used to perform specific operations: for example,
z=%rmr(x,y) is equivalent to z=x*y when x and z are rationals (i.e.
x=list('r',n,d,[]) with n and d polynomials).
For example if the file myfct.sci contains:
function [x,y]=myfct(a,b)
x=a+b
y=a-b
you can load and use it in the following way:
getf('pathname/myfct.sci','c')
[a,b]=myfct(1,2)
SEE ALSO
deff, getf, comp, lib.